

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Crash Module &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Insights 模块" href="../insights/" />
    <link rel="prev" title="iostat" href="../iostat/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../">Ceph 管理器守护进程</a> &raquo;</li>
        
      <li>Crash Module</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/mgr/crash.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../">
          

          
            
            <img src="../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 管理器守护进程</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../administrator/">安装和配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../modules/">模块编程</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orchestrator_modules/">编写 orchestrator 插件</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dashboard/">仪表盘模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ceph_api/">Ceph RESTful API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../alerts/">Alerts 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../diskprediction/">DiskPrediction 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../localpool/">localpool 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../restful/">RESTful 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../zabbix/">Zabbix 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../prometheus/">Prometheus 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../influx/">Influx 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hello/">Hello 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../telegraf/">Telegraf 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../telemetry/">Telemetry 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iostat/">Iostat 模块</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Crash 模块</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#enabling">Enabling</a></li>
<li class="toctree-l3"><a class="reference internal" href="#automated-collection">Automated collection</a></li>
<li class="toctree-l3"><a class="reference internal" href="#commands">Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="#options">Options</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../insights/">Insights 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orchestrator/">Orchestrator 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rook/">Rook 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw/">RGW 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mds_autoscaler/">MDS Autoscaler 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">NFS 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../progress/">Progress 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cli_api/">CLI API 命令模块</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="crash-module">
<h1>Crash Module<a class="headerlink" href="#crash-module" title="Permalink to this headline">¶</a></h1>
<p>The crash module collects information about daemon crashdumps and stores
it in the Ceph cluster for later analysis.</p>
<div class="section" id="enabling">
<h2>Enabling<a class="headerlink" href="#enabling" title="Permalink to this headline">¶</a></h2>
<p>The <em>crash</em> module is enabled with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mgr</span> <span class="n">module</span> <span class="n">enable</span> <span class="n">crash</span>
</pre></div>
</div>
<p>The <em>crash</em> upload key is generated with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">auth</span> <span class="n">get</span><span class="o">-</span><span class="ow">or</span><span class="o">-</span><span class="n">create</span> <span class="n">client</span><span class="o">.</span><span class="n">crash</span> <span class="n">mon</span> <span class="s1">&#39;profile crash&#39;</span> <span class="n">mgr</span> <span class="s1">&#39;profile crash&#39;</span>
</pre></div>
</div>
<p>On each node, you should store this key in
<code class="docutils literal notranslate"><span class="pre">/etc/ceph/ceph.client.crash.keyring</span></code>.</p>
</div>
<div class="section" id="automated-collection">
<h2>Automated collection<a class="headerlink" href="#automated-collection" title="Permalink to this headline">¶</a></h2>
<p>Daemon crashdumps are dumped in <code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/crash</span></code> by default; this can
be configured with the option ‘crash dir’.  Crash directories are named by
time and date and a randomly-generated UUID, and contain a metadata file
‘meta’ and a recent log file, with a “crash_id” that is the same.</p>
<p>These crashes can be automatically submitted and persisted in the monitors’
storage by using <code class="docutils literal notranslate"><span class="pre">ceph-crash.service</span></code>.
It watches the crashdump directory and uploads them with <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">crash</span> <span class="pre">post</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">ceph-crash</span></code> tries some authentication names: <code class="docutils literal notranslate"><span class="pre">client.crash.$hostname</span></code>,
<code class="docutils literal notranslate"><span class="pre">client.crash</span></code> and <code class="docutils literal notranslate"><span class="pre">client.admin</span></code>.
In order to successfully upload with <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">crash</span> <span class="pre">post</span></code>, these need
the suitable permissions: <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">profile</span> <span class="pre">crash</span></code> and <code class="docutils literal notranslate"><span class="pre">mgr</span> <span class="pre">profile</span> <span class="pre">crash</span></code>
and a keyring needs to be in <code class="docutils literal notranslate"><span class="pre">/etc/ceph</span></code>.</p>
</div>
<div class="section" id="commands">
<h2>Commands<a class="headerlink" href="#commands" title="Permalink to this headline">¶</a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">post</span> <span class="o">-</span><span class="n">i</span> <span class="o">&lt;</span><span class="n">metafile</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Save a crash dump.  The metadata file is a JSON blob stored in the crash
dir as <code class="docutils literal notranslate"><span class="pre">meta</span></code>.  As usual, the ceph command can be invoked with <code class="docutils literal notranslate"><span class="pre">-i</span> <span class="pre">-</span></code>,
and will read from stdin.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">rm</span> <span class="o">&lt;</span><span class="n">crashid</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Remove a specific crash dump.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">ls</span>
</pre></div>
</div>
<p>List the timestamp/uuid crashids for all new and archived crash info.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">ls</span><span class="o">-</span><span class="n">new</span>
</pre></div>
</div>
<p>List the timestamp/uuid crashids for all newcrash info.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">stat</span>
</pre></div>
</div>
<p>Show a summary of saved crash info grouped by age.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">info</span> <span class="o">&lt;</span><span class="n">crashid</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Show all details of a saved crash.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">prune</span> <span class="o">&lt;</span><span class="n">keep</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Remove saved crashes older than ‘keep’ days.  &lt;keep&gt; must be an integer.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">archive</span> <span class="o">&lt;</span><span class="n">crashid</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>Archive a crash report so that it is no longer considered for the <code class="docutils literal notranslate"><span class="pre">RECENT_CRASH</span></code> health check and does not appear in the <code class="docutils literal notranslate"><span class="pre">crash</span> <span class="pre">ls-new</span></code> output (it will still appear in the <code class="docutils literal notranslate"><span class="pre">crash</span> <span class="pre">ls</span></code> output).</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">crash</span> <span class="n">archive</span><span class="o">-</span><span class="nb">all</span>
</pre></div>
</div>
<p>Archive all new crash reports.</p>
</div>
<div class="section" id="options">
<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mgr/crash/warn_recent_interval</span></code> [default: 2 weeks] controls what constitutes “recent” for the purposes of raising the <code class="docutils literal notranslate"><span class="pre">RECENT_CRASH</span></code> health warning.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">mgr/crash/retain_interval</span></code> [default: 1 year] controls how long crash reports are retained by the cluster before they are automatically purged.</p></li>
</ul>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../insights/" class="btn btn-neutral float-right" title="Insights 模块" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../iostat/" class="btn btn-neutral float-left" title="iostat" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>